#include "udpClient.hpp"
#include <memory>
using namespace std;
using namespace client;

// ./udpClient server_ip server_port
// 客服端必须要填入客户端的ip与port
static void Usage(string proc)
{
    cout << "\nUsage:\n\t" << proc << " server_ip server_port\n\n";
}

int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }

    string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    unique_ptr<udpclient> uclient(new udpclient(serverip, serverport));

    uclient->initclient();
    uclient->run();

    return 0;
}